package com.bingxue.edu.management.education.model.req;


import com.bingxue.edu.common.enums.ClassCategoryEnum;
import com.bingxue.edu.common.enums.SaleStatusEnum;
import com.bingxue.edu.common.enums.TermEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;

import static com.bingxue.edu.common.constant.DateConstants.FORMAT_TIME_YMD_HMS;

/**
 * 创建班级信息
 *
 * @author zq
 * @since 2024/08/21 00:02
 */
@Data
@Schema(description = "创建班级信息")
public class ClassInfoCreateReq {

    @Schema(description="名称")
    @NotBlank(message = "名称不能为空")
    @Length(max = 64, message = "名称长度不能超过 {max} 个字符")
    private String name;

    @Schema(description="教学年份")
    @NotNull(message = "教学年份不能为空")
    private Integer classYear;

    @Schema(description="学期")
    @NotNull(message = "学期不能为空")
    private TermEnum term;

    @Schema(description="年级")
    @NotBlank(message = "年级不能为空")
    private String grade;

    @Schema(description="科目")
    @NotBlank(message = "科目不能为空")
    private String subject;

    @Schema(description="班级分类")
    @NotNull(message = "班级分类不能为空")
    private ClassCategoryEnum classCategory;

    @Schema(description="入学年份限制")
    @NotNull(message = "入学年份限制不能为空")
    private Integer admissionYearLimit;

    @Schema(description="班型")
    @NotBlank(message = "班型不能为空")
    @Length(max = 32, message = "班型长度不能超过 {max} 个字符")
    private String classTypeId;

    @Schema(description="班级等级限制（冗余字段）")
    @NotNull(message = "班级等级限制不能为空")
    private Integer classLevelLimit;

    @Schema(description="校区")
    @NotBlank(message = "校区不能为空")
    @Length(max = 32, message = "校区长度不能超过 {max} 个字符")
    private String campusId;

    @Schema(description="教室")
    @NotBlank(message = "教室不能为空")
    @Length(max = 32, message = "教室长度不能超过 {max} 个字符")
    private String classroomId;

    @Schema(description="主讲老师")
    @NotBlank(message = "主讲老师不能为空")
    @Length(max = 32, message = "主讲老师长度不能超过 {max} 个字符")
    private String leadTeacherId;

    @Schema(description="辅导老师")
    @Length(max = 32, message = "辅导老师长度不能超过 {max} 个字符")
    private String assistTeacherId;

    @Schema(description="计划招生")
    @NotNull(message = "计划招生不能为空")
    private Integer planStudentCount;

    @Schema(description="排课模板id")
    @NotBlank(message = "排课模板id不能为空")
    @Length(max = 32, message = "排课模板id长度不能超过 {max} 个字符")
    private String arrangeTemplateId;

    @Schema(description="上课时间模板id")
    @NotBlank(message = "上课时间模板id不能为空")
    @Length(max = 32, message = "上课时间模板id长度不能超过 {max} 个字符")
    private String timeTemplateId;

    @Schema(description="允许调课次数")
    @NotNull(message = "允许调课次数不能为空")
    private Integer lessonChangeLimit;

    @Schema(description="总价")
    @NotNull(message = "总价不能为空")
    private Double totalPrice;

    @Schema(description="单价")
    @NotNull(message = "单价不能为空")
    private Double unitPrice;

    @Schema(description="上架状态")
    @NotNull(message = "上架状态不能为空")
    private SaleStatusEnum saleStatus;

    @Schema(description="续报开始时间")
    @JsonFormat(pattern = FORMAT_TIME_YMD_HMS, timezone = "GMT+8")
    private LocalDateTime renewalStartTime;

    @Schema(description="续报结束时间")
    @JsonFormat(pattern = FORMAT_TIME_YMD_HMS, timezone = "GMT+8")
    private LocalDateTime renewalEndTime;

    @Schema(description="开放报名时间")
    @JsonFormat(pattern = FORMAT_TIME_YMD_HMS, timezone = "GMT+8")
    private LocalDateTime enrollStartTime;

    @Schema(description="课程图片")
    @Length(max = 255, message = "课程图片长度不能超过 {max} 个字符")
    private String image;

    @Schema(description="课程描述")
    @Length(max = 900, message = "课程描述长度不能超过 {max} 个字符")
    private String description;

    @Schema(description = "课时业绩系数")
    @NotNull(message = "课时业绩系数不能为空")
    private Double lessonHourFactor;

    @Schema(description = "销售业绩系数")
    @NotNull(message = "销售业绩系数不能为空")
    private Double salePerformanceFactor;

    @Schema(description="前序班级id")
    @Length(max = 32, message = "前序班级id长度不能超过 {max} 个字符")
    private String prevClassId;

    @Schema(description="是否导入前序班级学生")
    private Boolean importPrevStudent;
}
